From 406fc65c8790a2e3088dc880c13716887d7b7c18 Mon Sep 17 00:00:00 2001 From: Debian Science Team Date: Wed, 4 Nov 2020 18:36:11 +0000 Subject: [PATCH] Fix pytables expressions with Python 3.9 ast.Index has been replaced by a bare value, so we need to do the conversion from Constant to int Author: Rebecca N. Palmer Bug-Debian: https://bugs.debian.org/972015 Forwarded: https://github.com/pandas-dev/pandas/issues/37217 Gbp-Pq: Name python39_compat.patch --- pandas/core/computation/pytables.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pandas/core/computation/pytables.py b/pandas/core/computation/pytables.py index 001eb178..cc9baf88 100644 --- a/pandas/core/computation/pytables.py +++ b/pandas/core/computation/pytables.py @@ -425,6 +425,10 @@ class PyTablesExprVisitor(BaseExprVisitor): value = value.value except AttributeError: pass + try: + slobj = slobj.value + except AttributeError: + pass try: return self.const_type(value[slobj], self.env) -- 2.30.2